package com.tom.demo.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
* 用户与角色关联表
* @TableName sys_user_role
*/
@Data
@TableName(value = "sys_user_role")
public class SysUserRole implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
    * 用户id
    */
    @TableId(value = "user_id",type = IdType.ASSIGN_ID)
    @NotBlank(message="[用户id]不能为空")
    @Size(max= 30,message="编码长度不能超过30")
    @ApiModelProperty("用户id")
    @Length(max= 30,message="编码长度不能超过30")
    private String userId;
    /**
    * 角色id
    */
    @NotBlank(message="[角色id]不能为空")
    @Size(max= 30,message="编码长度不能超过30")
    @ApiModelProperty("角色id")
    @Length(max= 30,message="编码长度不能超过30")
    private String roleId;


}
